package com.itheima.admin.controller;


import com.itheima.admin.pojo.AdSensitive;
import com.itheima.admin.service.AdSensitiveService;
import com.itheima.common.dto.PageRequestDto;
import com.itheima.common.vo.PageResultVo;
import com.itheima.core.controller.AbstractCoreController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sensitive")
@Api(tags = "敏感词管理")
public class AdSensitiveController extends AbstractCoreController<AdSensitive> {


    private AdSensitiveService adSensitiveService;

    @Autowired
    public AdSensitiveController(AdSensitiveService adSensitiveService) {
        super(adSensitiveService);
        this.adSensitiveService = adSensitiveService;
    }

    /**
     * 敏感词分页查询
     *
     * @param dto
     * @return
     */
    @PostMapping("/list")
    @ApiOperation("敏感词分页查询")
    public PageResultVo pageList(@RequestBody PageRequestDto dto) {
        PageResultVo vo = findByPage(dto);
        return vo;
    }

}
